// --------------------------------------------------------------------------------------------------------------------
// <copyright file="AssertionHelper.cs" company="CSLib.Net Team">
//   Copyright (c) Roman "4ux-nbIx" Novitsky 2010
// </copyright>
// <summary>
//   Describes and manipulates the assert helpers.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace CSLib.Net.Diagnostics
{
  #region Namespace Imports

  using System;
  using System.Diagnostics;
  using System.Globalization;
  using System.Linq;

  using Annotations;

  #endregion

  // ReSharper disable ValueAnalysis

  /// <summary>
  /// Contains assert helper methods.
  /// </summary>
  [DebuggerStepThrough]
  [DebuggerNonUserCode]
  internal static class AssertionHelper
  {
    #region Methods

    internal static string GetDetailMessage([NotNull] string detailMessageFormat, [CanBeNull] object[] arguments)
    {
      return string.Format(CultureInfo.InvariantCulture, detailMessageFormat, arguments);
    }


    internal static bool IsNullOrWhiteSpace([CanBeNull] this string value)
    {
#if WINDOWS
      return string.IsNullOrWhiteSpace(value);
#else
      return value == null || value.All(t => char.IsWhiteSpace(t));
#endif
    }

    #endregion
  }
}